package cn.wolfcode.wolf2w.job.task;

import cn.wolfcode.wolf2w.api.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author 浪兎兎
 * @since 2025-06-05-14:33
 */
@Component("travelTask")
@Slf4j
public class TravelTask {

    @Autowired
    private RemoteStrategyService strategyService;
    @Autowired
    private RemoteQuestionService questionService;
    @Autowired
    private RemoteNoteService noteService;
    @Autowired
    private RemoteDestinationService destinationService;

    @Autowired
    private RemoteStrategyRankService strategyRankService;


    public void strategyStatusRedis2MySQL() {
        log.info("攻略数据持久化");
        strategyService.statusPersistence("inner");
    }

    //攻略排行版统计任务
    public void strategyRankStatis(){
        log.info("攻略排行版统计任务被调用");
        strategyService.strategyRankStatis("inner");
    }

    public void questionStatusRedis2MySQL() {
        log.info("问答数据持久化");
        questionService.questionPersistence("inner");
    }

    //判断攻略同步超时消息任务
    public void strategyToEsTimeout(){
        strategyService.reSendStrategyMessage("inner");
        questionService.reSendStrategyMessage("inner");
        noteService.reSendStrategyMessage("inner");
        destinationService.reSendStrategyMessage("inner");
    }

}
